package com.niit.web.controller;

import java.io.IOException;
import java.io.OutputStream;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.niit.service.JobService;
import com.niit.service.impl.JobServiceImpl;

@WebServlet("/DeleteJobController")
public class DeleteJobController extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String id = request.getParameter("id");
		JobService js = new JobServiceImpl();
		OutputStream os = response.getOutputStream();
		if(js.delete(js.findById(id))>0){
			os.write("删除成功".getBytes());
		}
	}

}
